<template>
  <div>
 <el-page-header onClick="javascript:history.back(-1);" >
    </el-page-header>
  <font style="text-align: center;">详情页面</font>
    <el-row >
      <el-col :span="11" offset="2">
        <img
          style="width:100%"
          src="https://assets.hermes.cn/is/image/hermesproduct/gamma%E7%9A%AE%E5%B8%A6%E6%89%A3-%E5%8F%8C%E9%9D%A2%E7%9A%AE%E8%85%B0%E5%B8%A613%E6%AF%AB%E7%B1%B3--beltkit-13-065538CAWI_composite_2-065985CDZ2_front_1-300-0-800-800_b.jpg"
        />
      </el-col>

      <el-col :span="11" class="infodiv1">
         <el-divider>服务名称</el-divider>
        <p style="margin-top:48px">{{current.serviceMerchant.name}}</p>
        <el-divider>价格</el-divider>
        <p>{{current.price}}￥</p>
        <el-divider>类型</el-divider>
        <p >{{current.type}}</p>
         <el-divider>服务时间段</el-divider>
          <p >{{current.supportTime}}</p>
        <el-divider>联系商家</el-divider>
        <p>{{current.serviceMerchant.phone}}</p>
        <el-divider>描述</el-divider>
        <p style="height: 60px;">{{current.introduce}}</p>

        <el-divider></el-divider>
        <div style="margin-top: 20px">
          <el-button type="info" style="margin-bottom:23px;margin-top:0px" @click="goShoppingBag()">预约服务</el-button>
        </div>
      </el-col>
      <el-col :span="2"></el-col>
    </el-row>
  </div>
</template>

<script>
export default {
    data(){
        return{
         current:{}
        }
    },



    methods:{
        // close:function(){
        //     this.$emit("close",false)
        // },
        // goBack() {
        //   javascript:history.back(-1)
        //     //this.$router.push("/Serviceall")
        // },
        goShoppingBag(){

             // scope.$index  获取当前第几个元素被点击了
            // scope.row 获取当前行的数据

            console.log(this.current)
            console.log("hhhhhhh")
            console.log("获取的mid:"+this.current.serviceMerchant.id)
            console.log("获取的cid:"+this.current.cid)
            console.log("获取的status:"+this.current.status)
            console.log("获取的price:"+this.current.price)
             this.$router.push({
                path:'/buyservice',
                query:{
                    mid:this.current.serviceMerchant.id,
                    iid:this.current.id,
                    cid:this.current.cid,
                    status:this.current.status,
                    price:this.current.price
                }
            })
        }
    },
    mounted(){
    // 同级路由传参用query

    this. current=this.$route.query.current
    console.log("current")
    console.log(this.current)

    }
}
</script>

<style>
.infodiv1 {
  background-color: lightyellow;
}
</style>
